# MIPI Camera - imx477 ***Copyright © Quectel Wireless Solutions Co., Ltd. 2026. All rights reserved.*** --- # Hardware interface The **Quectel Pi H1** single board computer supports two cameras **MIPI CSI** interfaces, as shown in the following figure ```{image} images/image_E6wabZZEso6ztzxZAbrckpuDnPe.webp :width: 901px :height: 500px ``` # Quick Start 1. Connect according to the following diagram. When connecting, pull up the black locking part of the connector and insert the **FPC** cable into any one **CSI** card slot. Pay attention to the gold finger of the cable facing the metal contact surface inside the board. Press the locking buckle to confirm that the **FPC** cable is stable and not loose. ```{image} images/image_RU04bTR7Ko4pBkx7QrccdF4Xnse.webp :width: 911px :height: 507px ``` 2. Refer to [Display configuration](<../../../Operating system/Debian/Display configuration/Display configuration.md>) to connect the display screen # Function usage ## Preconditions This step needs to be performed before the camera function is activated SSH terminal, please enter the following command ```bash export GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0:$GST_PLUGIN_PATHexport DISPLAY=:0 FILE_PATH=$(sudo find /run/user/1001 -type f -name '.mutter-*' | head -n 1) if [ -z "$FILE_PATH" ]; thenecho "not found .mutter file"elseecho "found:$FILE_PATH"export XAUTHORITY="$FILE_PATH"echo "XAUTHORITY set as:$XAUTHORITY"fi ``` In the GNOME desktop terminal, please enter the following command ```bash export GST_PLUGIN_PATH=/usr/lib/gstreamer-1.0:$GST_PLUGIN_PATH ``` ## Preview 1. Run the following command in the **device** terminal ```shell sudo -E gst-launch-1.0 -e qtiqmmfsrc name=camsrc ! 'video/x-raw,format=NV12,width=1280,height=720,framerate=30/1' ! autovideosink ``` 2. This command starts the camera with **720p 30 FPS** configuration and sends the image to the display screen for preview. If the **gst** pipeline status changes to **"PLAYING"**, it means the camera is running 3. If two **CSI** card slots are simultaneously inserted with two cameras, use **camera=0/1** to distinguish. **camera=0** represents the first **CSI** card slot, and **camera=1** represents the second **CSI** card slot. For example, to open the camera in the second **CSI** card slot, enter the following command: ```shell sudo -E gst-launch-1.0 -e qtiqmmfsrc name=camsrc camera=1 ! 'video/x-raw,format=NV12,width=1280,height=720,framerate=30/1' ! autovideosink ``` 4. If you want to stop the camera stream, please press `CTRL+C` ```{image} images/image_DwnNb06jDoJn1RxJcAOcSNJUnhf.webp :width: 1920px :height: 1080px ``` ## Preview + Video Recording 1. Run the following command in the **device** terminal: ```shell sudo -E gst-launch-1.0 -e \ qtiqmmfsrc name=camsrc video_1::type=preview ! \'video/x-raw,format=NV12,width=1280,height=720,framerate=30/1,interlace-mode=progressive,colorimetry=bt601' ! \ videocrop top=16 bottom=0 ! \tee name=t ! \ queue ! waylandsink \ t. ! \ queue ! v4l2h264enc capture-io-mode=5 output-io-mode=5 \ extra-controls="controls,video_bitrate=6000000,video_bitrate_mode=0;" ! \ queue ! h264parse ! mp4mux ! filesink location=/opt/11.mp4 ``` 2. This command starts the camera with **720p 30 FPS** configuration and saves it as a video file after **h264** video encoding. If the **gst** pipeline status changes to **"PLAYING"**, it means the camera is running 3. **MP4** files are saved in the **/opt/** directory 4. If you want to stop the camera recording, please press `CTRL+C` 5. To play a video file, please enter the following command:; You can also double-click on the **gnome** desktop to open the video playback directly ```shell sudo -E gst-launch-1.0 -e filesrc location=/opt/11.mp4 ! qtdemux ! queue ! h264parse ! v4l2h264dec capture-io-mode=5 output-io-mode=5 ! autovideosink ``` ## Preview + Photo 1. Run the following command in the **device** terminal: ```shell sudo -E gst-launch-1.0 -e \ qtiqmmfsrc name=camsrc ! \'video/x-raw,format=NV12,width=1280,height=720,framerate=30/1' ! \tee name=t ! \ queue ! videoconvert ! xvimagesink \ t. ! \ queue ! videoconvert ! jpegenc ! \ multifilesink location=shot-%05d.jpg max-files=1 ``` 2. This command starts the camera with a 720p 30 FPS configuration and saves it as an image file after encoding the JPEG video. If the **gst** pipeline status changes to **"PLAYING"**, it means the camera is running 3. If you want to shoot **n** continuously, you can modify the parameter **max files=n** 4. Press `Ctrl+C` to take a photo and exit 5. The generated file is shown in the following figure: ```{image} images/image_QXrsb0F0OojLNNxPTgTc646znmb.webp :width: 689px :height: 33px ``` 6. To view photos, please enter the following command; You can also double-click on the **gnome** desktop to open the photo for viewing ```shell sudo -E gst-launch-1.0 filesrc location=/opt/shot-00085.jpg ! jpegdec ! imagefreeze ! autovideosink ```